package com.entity;

import java.sql.Date;
import java.text.SimpleDateFormat;

public class PreorderPlus {
    private int gId;
    private int tId;
    private int uId;
    private Date pDate;
    private int pState;
    private String cName;
    private String uName;
    private String startTime;
    private String endTime;

    public int getgId() {
        return gId;
    }

    public void setgId(int gId) {
        this.gId = gId;
    }

    public int gettId() {
        return tId;
    }

    public void settId(int tId) {
        this.tId = tId;
    }

    public int getuId() {
        return uId;
    }

    public void setuId(int uId) {
        this.uId = uId;
    }

    public void setpDate(Date pDate) {
        this.pDate = pDate;
    }

    public String getuName() {
        return uName;
    }

    public void setuName(String uName) {
        this.uName = uName;
    }

    public String getpDate() {
        return String.valueOf(pDate);
    }

    public String getcName() {
        return cName;
    }

    public void setcName(String cName) {
        this.cName = cName;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public void setpDate(String dateString) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        try {
            java.util.Date date = sdf.parse(dateString);
            Date sqlDate = new Date(date.getTime());
            this.pDate = sqlDate;
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public int getpState() {
        return pState;
    }

    public void setpState(int pState) {
        this.pState = pState;
    }

    @Override
    public String toString() {
        return "PreorderPlus{" +
                "gId=" + gId +
                ", tId=" + tId +
                ", uId=" + uId +
                ", pDate=" + pDate +
                ", pState=" + pState +
                ", cName='" + cName + '\'' +
                ", uname='" + uName + '\'' +
                ", startTime='" + startTime + '\'' +
                ", endTime='" + endTime + '\'' +
                '}';
    }
}
